import java.util.Scanner;

public class Ex30 {
    public static int euclid(int i,int j){
        if(i<j){
            int tem = i;
            i = j;
            j = tem;
        }
        if(j==0) return i;

        return euclid(j,i%j);

    }
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        Boolean[][] array = new Boolean[N][N];
        for(int i = 0;i<N;i++){
            for(int j = 0;j<N;j++){
                array[i][j] = euclid(i,j)== 1;
                System.out.print(array[i][j]+" ");
            }
            System.out.println();
        }
    }
}
